package com.szpx.service.impl;

import com.szpx.entity.TbComment;
import com.szpx.mapper.TbCommentMapper;
import com.szpx.service.TbCommentService;
import com.szpx.vo.TbCommentVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (TbComment)表服务实现类
 *
 * @author ljx
 * @since 2024-04-07 23:09:27
 */
@Service("tbCommentService")
public class TbCommentServiceImpl implements TbCommentService {
    @Resource
    private TbCommentMapper tbCommentMapper;

    /**
     * 分页查询
     *
     * @param tbComment 筛选条件
     * @return 查询结果
     */
    @Override
    public List<TbCommentVo> queryAll(TbComment tbComment) {
        return this.tbCommentMapper.queryAll(tbComment);
    }

    /**
     * 新增数据
     *
     * @param tbComment 实例对象
     * @return 实例对象
     */
    @Override
    public int insert(TbComment tbComment) {
        return this.tbCommentMapper.insert(tbComment);
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Integer id) {
        return this.tbCommentMapper.deleteById(id) > 0;
    }
}
